<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of linkdatabase
 *
 * @author 12502
 */
class linkdatabase {

    public static function link() {
        $link = mysqli_connect("localhost", "root", "jjUgP6yD");
        if(!$link){
            echo "can not link to database";
        }else{
					mysqli_set_charset($link, 'utf8mb4');
            return $link;
        }
    }

    public static function linkSample() {
        $selected = mysqli_select_db(linkdatabase::link(), "book");
        if(!$selected){
            echo "can not link to book";
        }
        return $selected;
    }
  
}
